#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
#                                 Walter Szeliga 
#                        NASA Jet Propulsion Laboratory
#                      California Institute of Technology
#                        (c) 2010  All Rights Reserved
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


#!/usr/bin/env python
import os

Import('envcontrib')
envSnaphu = envcontrib.Clone()
project = 'Snaphu'
package = envSnaphu['PACKAGE']
envSnaphu['PROJECT'] = project
Export('envSnaphu')

bindingsScons = os.path.join('bindings','SConscript')
SConscript(bindingsScons,variant_dir = os.path.join(envSnaphu['PRJ_SCONS_BUILD'],package,project,'bindings'))

includeScons = os.path.join('include','SConscript')
SConscript(includeScons)

srcScons = os.path.join('src','SConscript')
SConscript(srcScons,variant_dir = os.path.join(envSnaphu['PRJ_SCONS_BUILD'],package,project,'src'))

initFile = '__init__.py'
if not os.path.exists(initFile):
	fout = open(initFile,"w")
	fout.write("#!/usr/bin/env python")
	fout.close()

install = os.path.join(envSnaphu['PRJ_SCONS_INSTALL'],package,project)

helpList,installHelp = envSnaphu['HELP_BUILDER'](envSnaphu,'__init__.py',install)
envSnaphu.Install(installHelp,helpList)
envSnaphu.Alias('install',installHelp)

listFiles = ['Snaphu.py',initFile]
envSnaphu.Install(install,listFiles)
envSnaphu.Alias('install',install)
